const express = require('express');
const router = express.Router();
const {
  addKeyword,
  getKeywords,
  getKeywordStats,
  analyzeKeyword,
  trackKeywordRanking
} = require('../controllers/keywordController');
const { protect } = require('../middleware/authMiddleware');

// 关键词管理路由
router.route('/')
  .post(protect, addKeyword)
  .get(protect, getKeywords);

// 关键词分析路由
router.get('/:id/stats', protect, getKeywordStats);
router.post('/analyze', protect, analyzeKeyword);
router.post('/track-ranking', protect, trackKeywordRanking);

module.exports = router;